package com.entity.sales0rder;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

import java.math.BigDecimal;
import java.sql.Timestamp;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("order_products")
public class OrderProduct {

    @ApiModelProperty(value = "订单产品ID，主键，唯一标识每个订单中的产品")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "销售订单ID，关联到销售订单表")
    @TableField("sales_order_id")
    private Long salesOrderId;

    @ApiModelProperty(value = "产品ID，关联到产品表")
    @TableField("product_id")
    private Long productId;

    @ApiModelProperty(value = "产品数量")
    @TableField("quantity")
    private Integer quantity;

    @ApiModelProperty(value = "备注信息")
    @TableField("remark")
    private String remark;

    @ApiModelProperty(value = "产品单价")
    @TableField("unit_price")
    private BigDecimal unitPrice;

    @ApiModelProperty(value = "产品总价（数量 * 单价）")
    @TableField("total_price")
    private BigDecimal totalPrice;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Timestamp createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private Timestamp updateTime;

    @ApiModelProperty(value = "供货时间")
    @TableField("delivery_time")
    private String deliveryTime;
}